/**
 * 
 */
package com.java.test.user.dto;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;

import org.springframework.jdbc.core.RowMapper;

/**
 * @author 提现记录
 *
 */
public class ReflectInfo implements RowMapper<ReflectInfo> {
	// 主键id
	private int id;

	// 存款账号
	private String gameAccount;

	// 存款金额
	private double reflectAmount;

	// 存款时间
	private LocalDateTime reflectTime;

	// 存款账号
	private String bankAccount;

	// 提现渠道
	private int reflectChannel;

	//
	private String reflectChannelName;

	// ( 审核状态1：成功？：2：失败)
	private int status;

	// 审核人
	private String reviewer;

	// 审核时间
	private LocalDateTime reviewTime;

	// 手续费
	private double sxfCharge;

	// 到账金额
	private double dzjeAmount;

	public String getReviewer() {
		return reviewer;
	}

	public void setReviewer(String reviewer) {
		this.reviewer = reviewer;
	}

	public LocalDateTime getReviewTime() {
		return reviewTime;
	}

	public void setReviewTime(LocalDateTime reviewTime) {
		this.reviewTime = reviewTime;
	}

	public int getId() {
		return id;
	}

	public String getReflectChannelName() {
		return reflectChannelName;
	}

	public void setReflectChannelName(String reflectChannelName) {
		this.reflectChannelName = reflectChannelName;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getGameAccount() {
		return gameAccount;
	}

	public void setGameAccount(String gameAccount) {
		this.gameAccount = gameAccount;
	}

	public double getReflectAmount() {
		return reflectAmount;
	}

	public void setReflectAmount(double reflectAmount) {
		this.reflectAmount = reflectAmount;
	}

	public LocalDateTime getReflectTime() {
		return reflectTime;
	}

	public void setReflectTime(LocalDateTime reflectTime) {
		this.reflectTime = reflectTime;
	}

	public String getBankAccount() {
		return bankAccount;
	}

	public void setBankAccount(String bankAccount) {
		this.bankAccount = bankAccount;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getReflectChannel() {
		return reflectChannel;
	}

	public void setReflectChannel(int reflectChannel) {
		this.reflectChannel = reflectChannel;
	}

	// 查詢條件
	private String startTime;
	// 查詢條件
	private String endTime;

	// 当前日期
	private String curDate;

	public String getCurDate() {
		return curDate;
	}

	public void setCurDate(String curDate) {
		this.curDate = curDate;
	}

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public double getSxfCharge() {
		return sxfCharge;
	}

	public void setSxfCharge(double sxfCharge) {
		this.sxfCharge = sxfCharge;
	}

	public double getDzjeAmount() {
		return dzjeAmount;
	}

	public void setDzjeAmount(double dzjeAmount) {
		this.dzjeAmount = dzjeAmount;
	}

	@Override
	public ReflectInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
		ReflectInfo info = new ReflectInfo();
		info.setId(rs.getInt("id"));
		info.setGameAccount(rs.getString("game_account"));
		info.setBankAccount(rs.getString("bank_account"));
		info.setStatus(rs.getInt("status"));
		info.setReflectAmount(rs.getDouble("reflect_amount"));
		info.setReflectTime(
				rs.getTimestamp("reflect_time").toInstant().atZone(ZoneOffset.ofHours(8)).toLocalDateTime());
		info.setReflectChannel(rs.getInt("reflect_channel"));
		info.setReflectChannelName(rs.getString("reflect_channel_name"));
		info.setReviewer(rs.getString("reviewer"));

		info.setReviewTime(rs.getTimestamp("review_time") == null ? null
				: rs.getTimestamp("review_time").toInstant().atZone(ZoneOffset.ofHours(8)).toLocalDateTime());

		info.setSxfCharge(rs.getDouble("sxf_charge"));
		info.setDzjeAmount(rs.getDouble("dzje_amount"));
		return info;
	}
}
